package com.mpyy.pojo;

import lombok.*;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @version 1.0  商品退货查询上部分表格
 * @Descrioption SaleOrderAndSaleReturn
 * @Author QIAO
 * @Date 2022-03-12 10:26
 */
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class SaleOrderAndSaleReturn {
    private String orsalOrdId;

    private Date orsalOrdDate;

    private String orcustName;

    private String ordepotName;

    private Double orsalOrdReceivable;

    private Double orsalOrdPaidIn;

    private String orempName;

    private String orsalOrdComment;

    //分页参数
    private Integer page;

    private Integer limit;

    public void setPage(Integer page){
        this.page = ( page - 1 ) * this.limit;
    }

    //搜索，开始日期
    private Date currentTimeStart;
    //搜索，结束日期
    private Date currentTimeEnd;

    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");

    public void setCurrentTimeStart(String currentTimeStart){
        try {
            this.currentTimeStart = simpleDateFormat.parse(currentTimeStart);
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }

    public void setCurrentTimeEnd(String currentTimeEnd){
        try {
            this.currentTimeEnd = simpleDateFormat.parse(currentTimeEnd);
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }
    //搜索框内的客户名称或单号
    private String orcustNameAndId;
}
